package com.ruoyi.ybUpload.service.tableCode.impl;


import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.ybUpload.domain.tableCode.ZsEntryStock;
import com.ruoyi.ybUpload.service.tableCode.IZsEntryStockService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.ybUpload.mapper.ZsEntryStockMapper;

import java.util.List;

/**
 * 商品采购Service业务层处理
 *
 * @author ruoyi
 * @date 2024-09-03
 */
@Service
public class ZsEntryStockServiceImpl implements IZsEntryStockService
{
    @Autowired
    private ZsEntryStockMapper zsEntryStockMapper;

    /**
     * 查询商品采购
     *
     * @param id 商品采购主键
     * @return 商品采购
     */
    @Override
    public ZsEntryStock selectZsEntryStockById(Long id)
    {
        return zsEntryStockMapper.selectZsEntryStockById(id);
    }

    /**
     * 查询商品采购列表
     *
     * @param zsEntryStock 商品采购
     * @return 商品采购
     */
    @Override
    public List<ZsEntryStock> selectZsEntryStockList(ZsEntryStock zsEntryStock)
    {
        return zsEntryStockMapper.selectZsEntryStockList(zsEntryStock);
    }

    /**
     * 新增商品采购
     *
     * @param zsEntryStock 商品采购
     * @return 结果
     */
    @Override
    public int insertZsEntryStock(ZsEntryStock zsEntryStock)
    {
        zsEntryStock.setDelFlag(0L);
        zsEntryStock.setCreateTime(DateUtils.getNowDate());
        return zsEntryStockMapper.insertZsEntryStock(zsEntryStock);
    }

    /**
     * 修改商品采购
     *
     * @param zsEntryStock 商品采购
     * @return 结果
     */
    @Override
    public int updateZsEntryStock(ZsEntryStock zsEntryStock)
    {
        zsEntryStock.setUpdateTime(DateUtils.getNowDate());
        return zsEntryStockMapper.updateZsEntryStock(zsEntryStock);
    }

    /**
     * 批量删除商品采购
     *
     * @param ids 需要删除的商品采购主键
     * @return 结果
     */
    @Override
    public int deleteZsEntryStockByIds(Long[] ids)
    {
        return zsEntryStockMapper.deleteZsEntryStockByIds(ids);
    }

    /**
     * 删除商品采购信息
     *
     * @param id 商品采购主键
     * @return 结果
     */
    @Override
    public int deleteZsEntryStockById(Long id)
    {
        return zsEntryStockMapper.deleteZsEntryStockById(id);
    }
}